package com.example.achartenginepiechart;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;

public class MainActivity extends Activity implements OnClickListener {
    Button efforts;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        efforts = (Button) findViewById(R.id.Efforts_bt_Graph);
        efforts.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
    	switch(v.getId()){
    	case R.id.Efforts_bt_Graph:
            PieGraph effort = new PieGraph();
            
            
            LinearLayout layout1 = (LinearLayout)findViewById(R.id.layout1);
            LinearLayout layout2 = (LinearLayout)findViewById(R.id.layout2);
            
            View effortIntent = effort.getIntent(this);
            layout1.addView(effortIntent);
            effortIntent = effort.getIntent(this);
            layout2.addView(effortIntent);
            
//            startActivity(effortIntent);
            break;
        }
    }
}



